

#ifndef UC_GEARC3D_H
#define UC_GEARC3D_H

#include "zgecurv3d.h"
#include "zgevec3d.h"
#include "zgepnt3d.h"
#include "zgeplane.h"
#include "zgegblabb.h"
#pragma pack (push, 8)
class UcGeLine3d;
class UcGeCircArc2d;
class UcGePlanarEnt;

class 
GE_DLLEXPIMPORT
UcGeCircArc3d : public UcGeCurve3d
{
public:
    UcGeCircArc3d();
    UcGeCircArc3d(const UcGeCircArc3d& arc);
    UcGeCircArc3d(const UcGePoint3d& cent,
                  const UcGeVector3d& nrm, double radius);
    UcGeCircArc3d(const UcGePoint3d& cent, const UcGeVector3d& nrm,
                  const UcGeVector3d& refVec, double radius,
                  double startAngle, double endAngle);
    UcGeCircArc3d(const UcGePoint3d& startPoint, const UcGePoint3d& pnt, const UcGePoint3d& endPoint);

    UcGePoint3d    closestPointToPlane (const UcGePlanarEnt& plane,
                                        UcGePoint3d& pointOnPlane,
                                        const UcGeTol& tol
                                        = UcGeContext::gTol) const;

    ZSoft::Boolean intersectWith  (const UcGeLinearEnt3d& line, int& intn,
                                   UcGePoint3d& p1, UcGePoint3d& p2,
                                   const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean intersectWith  (const UcGeCircArc3d& arc, int& intn,
                                   UcGePoint3d& p1, UcGePoint3d& p2,
                                   const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean  intersectWith (const UcGePlanarEnt& plane, int& numOfIntersect,
                                   UcGePoint3d& p1, UcGePoint3d& p2,
                                   const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean projIntersectWith (const UcGeLinearEnt3d& line,
                                      const UcGeVector3d& projDir, int& numInt,
                                      UcGePoint3d& pntOnArc1,
                                      UcGePoint3d& pntOnArc2,
                                      UcGePoint3d& pntOnLine1,
                                      UcGePoint3d& pntOnLine2,
                                      const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean tangent        (const UcGePoint3d& pnt, UcGeLine3d& line,
                                   const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean tangent        (const UcGePoint3d& pnt, UcGeLine3d& line,
                                   const UcGeTol& tol, UcGeError& error) const;

    void           getPlane       (UcGePlane& plane) const;

    ZSoft::Boolean isInside       (const UcGePoint3d& pnt,
                                   const UcGeTol& tol = UcGeContext::gTol) const;

    UcGePoint3d    center         () const;
    UcGeVector3d   normal         () const;
    UcGeVector3d   refVec         () const;
    double         radius         () const;
    double         startAng       () const;
    double         endAng         () const;
    UcGePoint3d    startPoint     () const;
    UcGePoint3d    endPoint       () const;

    UcGeCircArc3d& setCenter      (const UcGePoint3d&);
    UcGeCircArc3d& setAxes        (const UcGeVector3d& normal,
                                   const UcGeVector3d& refVec);
    UcGeCircArc3d& setRadius      (double);
    UcGeCircArc3d& setAngles      (double startAngle, double endAngle);

    UcGeCircArc3d& set            (const UcGePoint3d& cent,
                                   const UcGeVector3d& nrm, double radius);
    UcGeCircArc3d& set            (const UcGePoint3d& cent,
                                   const UcGeVector3d& nrm,
                                   const UcGeVector3d& refVec, double radius,
                                   double startAngle, double endAngle);
    UcGeCircArc3d& set            (const UcGePoint3d& startPoint, const UcGePoint3d& pnt,
                                   const UcGePoint3d& endPoint);
    UcGeCircArc3d& set            (const UcGePoint3d& startPoint, const UcGePoint3d& pnt,
                                   const UcGePoint3d& endPoint, UcGeError& error);

    UcGeCircArc3d& set            (const UcGeCurve3d& curve1,
                                   const UcGeCurve3d& curve2,
                                   double radius, double& param1, double& param2,
								   ZSoft::Boolean& success);

    UcGeCircArc3d& set            (const UcGeCurve3d& curve1,
                                   const UcGeCurve3d& curve2,
                                   const UcGeCurve3d& curve3,
                                   double& param1, double& param2, double& param3,
								   ZSoft::Boolean& success);

    UcGeCircArc3d& operator =     (const UcGeCircArc3d& arc);
};

#pragma pack (pop)
#endif
